<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <title>layout 管理系统大布局 - Layui</title>
  <link rel="stylesheet" href="/static/libs/layui/css/layui.css">
</head>
<body>
<div class="layui-layout layui-layout-admin">
  <div class="layui-header">
    <div class="layui-logo layui-hide-xs layui-bg-black">layout demo</div>
    <!-- 头部区域（可配合layui 已有的水平导航） -->
    <ul class="layui-nav layui-layout-right">
      <li class="layui-nav-item layui-hide layui-show-md-inline-block">
        哈哈哈哈
      </li>
    </>
  </div>
  
  <div class="layui-side layui-bg-black">
    <div class="layui-side-scroll">
      <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
      <ul class="layui-nav layui-nav-tree" lay-filter="test">
        <li class="layui-nav-item"><a href="javascript:;" class="link" _href="/main">首页</a></li>
        <li class="layui-nav-item"><a href="javascript:;" class="link" _href="/itemList">商品管理</a></li>
        <li class="layui-nav-item"><a href="javascript:;" class="link" _href="http://www.baidu.com">去百度</a></li>
      </ul>
    </div>
  </div>
  
  <div class="layui-body">
    <!-- 内容主体区域 -->
    <div style="padding: 15px; height: 100%">
      <iframe id="frame" src="/main" width="100%" height="100%" frameborder="0"></iframe>
    </div>
  </div>
  
  <div class="layui-footer">
    <!-- 底部固定区域 -->
    底部固定区域
  </div>
</div>
<script src="/static/libs/layui/layui.js"></script>
<script>
//JS 
layui.use(['element', 'layer', 'jquery'], function(){
  var element = layui.element
  ,layer = layui.layer
  ,$ = layui.$;
  $('.link').click(function(){
    $("#frame").attr('src', $(this).attr("_href"))
  })
  
});
</script>
</body>
</html>